<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%@ taglib  prefix="c"   uri="http://java.sun.com/jsp/jstl/core"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    

	<script type="text/javascript">
		
		function send() {
		
			/**
			*     JS 代码
			*/
			
			document.forms[0].submit();
			
			//document.frm.submit();
		}
	
	</script>

  </head>
  
  <body>
 	<jsp:include page="/jsp/head.jsp" ></jsp:include>
  	
  	<hr/>
  	<ul>
  		
  		<li><a href="servlet/EmpServlet?method=getEmps"> Query  EMPS </a></li>
  		<li><a href="/WebDemo2/jsp/QueryEmp.jsp"> Query  EMPS By Conditions </a></li>
  		<li><a href="servlet/EmpServlet?method=getEmpsByPage"> Query  EMPS By Page </a></li>
  		<li><a href="/WebDemo2/jsp/saveProduct.jsp"> Add Product </a></li>
  		<li><a href="servlet/ProductServlet"> Query All Product </a></li>
  		
  		<li><a href="servlet/CartServlet"> Show Cart </a></li>
  		<li><a href="/WebDemo2/jsp/showProductsByAjax.jsp"> Show Product by Ajax </a></li>
  		<li><a href="/WebDemo2/jsp/saveDept.jsp"> Add Dept </a></li>
  		
  	</ul>
  	
  	<hr/>
  
  	<h4>Emp Info</h4>
  
    <form action="servlet/EmpServlet"  method="post" name="frm">
    	
    	<input type="hidden"   name="method"  value="saveEmp" />
    	<fieldset>
    		<legend>基本信息录入</legend>
    		
    		<table>
    			<tr>
    				<td>Name : </td>
    				<td><input  type="text"  name="name" /></td>
    			</tr>
    			<tr>
    				<td>Sex : </td>
    				<td>
    					<label><input  type="radio""  name="sex"   value="0" />男</label>
    					<label><input  type="radio""  name="sex"  value="1" />女</label>
    				</td>
    			</tr>
    			<tr>
    				<td>Degree : </td>
    				<td>
    					<select name="degree" >
    						<option value="专科" >专科</option>
    						<option value="本科" >本科</option>
    						<option value="硕士" >硕士</option>
    						<option value="博士" >博士</option>
    					</select>
    				</td>
    			</tr>
    			<tr>
    				<td>Work : </td>
    				<td>
    					<label><input  type="checkbox""  name="work"   value="oracle"/>oracle</label>
    					<label><input  type="checkbox""  name="work"    value="java" /> java</label>
    					<label><input  type="checkbox""  name="work"    value="android" />android </label>
    					<label><input  type="checkbox""  name="work"     value="ajax" /> ajax</label>
    				</td>
    			</tr>
    			<tr>
    				<td>Dept  :</td>
    				<td>
    					<select name="deptId" >
    						<c:forEach var="dept"   items="${applicationScope.depts }">	
    							<option value="${dept.key }">${dept.value }</option>		
    						</c:forEach>
    					</select>
    				</td>
    			</tr>
    		</table>
			<br/>
    	</fieldset>
    	  	
    	
    	<button onclick="send()">提交</button>
    </form>
  </body>
</html>
